<!DOCTYPE html>
<html>
<head>
   
    <title>美托洛尔</title>
    <meta charset="UTF-8">
    <link rel="stylesheet" href="../css/mtle.css"></link>
    <script type="text/javascript">
        function calculate() {
            var age = document.getElementById('age').value;
            var MPV = document.getElementById('MPV').value;

            var y = -13.516 - 0.278 * age + 1.654 * MPV;
            var p = 1 / (1 + Math.exp(-y));

            document.getElementById('result').innerHTML = "p值： " + p.toFixed(3);

            if (p >= 0.532) {
                document.getElementById('treatment').innerHTML = "预测治疗有效，推荐美托洛尔治疗。";
            } else {
                document.getElementById('treatment').innerHTML = "预测治疗无效，不推荐美托洛尔治疗。";
            }
        }
    </script>
</head>
<body>
    <div class="bg">
        <img src="../img/bg2.jpg" style="height: 450px;width: 100%;">
    </div>
    <div class="text2">
        <p>美托洛尔治疗儿童血管迷走性晕厥疗效预测</p>
    </div>
    <div class="text">
        <div class="age-text">
            Age (year): &nbsp;&nbsp;<input type="number" id="age" class="a" any="age"><br>
        </div>
        <div class="mpv-text">
            &nbsp;&nbsp;&nbsp;&nbsp;MPV (fl): &nbsp;&nbsp;<input type="number" id="MPV" class="m"><br>
        </div>
    </div>

    <div class="butt">
        <button onclick="calculate()" style="padding: 5px 10px;">提交</button> 
    </div>

    <div class="r">
        <p id="result" style="text-align: center;"></p><br>
   
    </div>
    <div class="r-box" id="treatment">
        
    </div>

    <div class="box">
        <div class="text3">
            <p>注释：<br>
                Age：患者年龄，单位：岁。<br>
                MPV：血小板平均体积，单位：fl。<br>
            </p>
        </div>
    </div>

    <div class="home">
        <button class="button1"><a style="text-decoration: none;color: black;" href="./index.html">首页</a></button>
    </div>
</body>
</html>
